package com.melody.android.ui.activity

import android.os.Bundle
import androidx.lifecycle.ViewModelProvider
import com.melody.android.R
import com.melody.android.databinding.ActivitySongListBinding
import com.melody.android.logic.model.Song
import com.melody.android.logic.util.setSongList
import com.melody.android.ui.viewModel.SongViewModel

class SongListActivity : BaseActivity() {

    private lateinit var binding: ActivitySongListBinding
    private lateinit var songViewModel: SongViewModel
    private lateinit var songListDescription: String
    private val recommendSongs = ArrayList<Song>()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivitySongListBinding.inflate(layoutInflater)
        setContentView(binding.root)

        // 初始化SongViewModel
        songViewModel = ViewModelProvider(this)[SongViewModel::class.java]
        initView()
    }

    private fun initView() {
        songListDescription = intent.getStringExtra("songListDescription").toString()
        initRecommendSongs()
        binding.rvRecommendSong.setSongList(songViewModel, recommendSongs)
    }

    private fun initRecommendSongs() {
        when (songListDescription) {
            "Jay" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_1, "可爱女人", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_1, "完美主义", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_2, "星晴", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_1, "娘子", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_1, "斗牛", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_1, "黑色幽默", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_2, "伊斯坦堡", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_2, "印第安老斑鸠", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_1, "龙卷风", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jay_1, "反方向的钟", "周杰伦"))
            }
            "范特西" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "爱在西元前", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "爸我回来了", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "简单爱", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "忍者", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "开不了口", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "上海一九四三", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "对不起", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "威廉古堡", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "双截棍", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx, "安静", "周杰伦"))
            }
            "范特西-plus" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx_plus, "蜗牛", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ftx_plus, "世界末日", "周杰伦"))
            }
            "八度空间" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "半兽人", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "半岛铁盒", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "暗号", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "龙拳", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "火车叨位去", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "分裂", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "爷爷泡的茶", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "回到过去", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "米兰的小铁匠", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_bdkj, "最后的战役", "周杰伦"))
            }
            "叶惠美" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "以父之名", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "懦夫", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "晴天", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "三年二班", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "东风破", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "你听得到", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "同一种调调", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "她的睫毛", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "爱情悬崖", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "梯田", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yhm, "双刀", "周杰伦"))
            }
            "寻找周杰伦" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_xzzjl, "轨迹", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_xzzjl, "断了的弦", "周杰伦"))
            }
            "七里香" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "我的地盘", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "七里香", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "借口", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "外婆", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "将军", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "搁浅", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "乱舞春秋", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "困兽之斗", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "园游会", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_qlx, "止战之殇", "周杰伦"))
            }
            "十一月的肖邦" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "夜曲", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "蓝色风暴", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "发如雪", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "黑色毛衣", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "四面楚歌", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "枫", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "浪漫手机", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "逆鳞", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "麦芽糖", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "珊瑚海", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "漂移", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_syydxb, "一路向北", "周杰伦"))
            }
            "霍元甲" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_hyj, "霍元甲", "周杰伦"))
            }
            "依然范特西" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "夜的第七章", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "听妈妈的话", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "本草纲目", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "退后", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "红模仿", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "心雨", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "白色风车", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "迷迭香", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_yrftx, "菊花台", "周杰伦"))
            }
            "我很忙" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "牛仔很忙", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "彩虹", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "青花瓷", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "阳光宅男", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "蒲公英的约定", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "无双", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "我不配", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "扯", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "甜甜的", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_whm, "最长的电影", "周杰伦"))
            }
            "不能说的秘密" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_bnsdmm, "不能说的秘密", "周杰伦"))
            }
            "魔杰座" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "龙战骑士", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "蛇舞", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "花海", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "魔术先生", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "说好的幸福呢", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "兰亭序", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "流浪诗人", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "乔克叔叔", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_mjz, "稻香", "周杰伦"))
            }
            "跨时代" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_ksd, "说了再见", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ksd, "烟花易冷", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ksd, "免费教学录影带", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ksd, "雨下一整晚", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ksd, "我落泪情绪零碎", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ksd, "爱的飞行日记", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ksd, "自导自演", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_ksd, "超人不会飞", "周杰伦"))
            }
            "惊叹号" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "惊叹号", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "皮影戏", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "Mine Mine", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "你好吗", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "迷魂曲", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "超跑女神", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "世界未末日", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "水手怕水", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "琴伤", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "公主病", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_jth, "疗伤烧肉粽", "周杰伦"))
            }
            "十二新作" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "四季列车", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "手语", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "公公偏头痛", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "明明就", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "傻笑", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "比较大的大提琴", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "红尘客栈", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "梦想启动", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "大笨钟", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "哪里都是你", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_sexz, "乌克丽丽", "周杰伦"))
            }
            "哎呦不错哦" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "阳明山", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "窃爱", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "算什么男人", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "天涯过客", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "怎么了", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "一口气全念对", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "我要夏天", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "手写的从前", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "鞋子特大号", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "听爸爸的话", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "美人鱼", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_aybco, "听见下雨的声音", "周杰伦"))
            }
            "周杰伦床边故事" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "床边故事", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "说走就走", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "一点点", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "前世情人", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "英雄", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "不该", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "土耳其冰淇淋", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "告白气球", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "Now You See Me", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zjlcbgs, "爱情废柴", "周杰伦"))
            }
            "最伟大的作品" -> {
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "还在流浪", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "说好不哭", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "红颜如霜", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "不爱我就拉倒", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "Mojito", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "错过的烟火", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "等你下课", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "粉色海洋", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "倒影", "周杰伦"))
                recommendSongs.add(Song(R.drawable.img_song_cover_zwddzp, "我是如此相信", "周杰伦"))
            }
        }
    }

}